﻿@model IEnumerable<BugTracker.Models.User>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<center>

   @{WebGrid webGrid = new WebGrid(canSort: false, canPage: true, rowsPerPage: 2, ajaxUpdateContainerId: "grid", defaultSort: "issue_idPK", pageFieldName: "Page");
    webGrid.Bind(Model, autoSortAndPage: true, rowCount: Model.Count());    
    }                 

        
<div id="grid">
@webGrid.GetHtml(htmlAttributes: new { id = "grid" },
        alternatingRowStyle: "altrow",
        mode: WebGridPagerModes.All,
               firstText: "<<first",
               previousText: "<previous",
               nextText: "next >",
               lastText: "last >>",

             columns: webGrid.Columns(
                          webGrid.Column(columnName: "Username", format: (item) => item.user_name),
                          webGrid.Column(columnName: "First Name", format: (item) => item.first_name),
                          webGrid.Column(columnName: "Last Name", format: (item) => item.last_name),
                              webGrid.Column(columnName: "Role", format: (item) => item.role_idFK)
                                                         ))
</div> 
<br />
</center>
<h4>
        Page Count:
        @Html.Encode(webGrid.PageCount)

<br />
        Total Record:
        @Html.Encode(webGrid.TotalRowCount)
</h4>
